/* 1. 创建理由规则  2. 创建路由实例 3. 创建组件进行测试 4. 配置路由出口 */
import {
    createRouter,
    createWebHashHistory
} from "vue-router";


const routes = [{
        path: '/login',
        name: 'login',
        component: () => import('../View/Login/index.vue'),
    },
    {
        path: "/",
        name: 'layout',
        component: () => import('../View/Layout/index.vue'),
        children: [{
                path: "/",
                name: 'home',
                meta:{userType: 1 ,menuName:'首页'},
                component: () => import('../View/Home/index.vue'),
            }, {
                path: "/goods",
                name: 'goods',
                component: () => import('../View/Good/index.vue')
            },
            {
                path: "/order",
                name: 'order',
                meta:{userType: 1 ,menuName:'商品列表页'},
                component: () => import('../View/Order/index.vue'),
                children: [{
                    path: "/OrderPay",
                    name: 'OrderPay',
                    meta:{userType: 1 ,menuName:'订单列表页'},
                    component: () => import('../View/Order/OrderPay/index.vue'),
                }, {
                    path: "/OrderBack",
                    name: 'OrderBack',
                    component: () => import('../View/Order/OrderBack/index.vue'),
                },
            {
                path: '/Jurisdiction',
                name:'Jurisdiction',
                meta:{userType: 2 ,menuName:'权限管理页'},
                component:()=>import('../View/Jurisdiction/index.vue'),
            }]
            }
        ]
    }
];

const router = createRouter({
    history: createWebHashHistory(),
    routes,
    
});


export default router;